import { objDeepCopy,getDateString } from "@/assets/js/common.js";
import commonObject from "@/assets/js/xm.js";
let Controller = {
	created() {
		this.init();
	},
	mounted() {
		
	},
	methods: {
		init() {
			this.getList(this);
		},
		//获取列表
		getList(that,params,pageIndex = 1,pageSize = 10) {
			params = params || {};
			var apiTest = this.apiTest;
			this.$ajax({
					method: 'post',
					url:apiTest+'/supplier/supplierQualityRecordReturn/list',
					data:{
						condition:params,
						pageIndex: pageIndex,
						pageSize: pageSize,
					}
			    }).then((res)=>{
					this.Model.tableData = [];
					var data = res.data;
					if(data.status == 200&&data.result){
						data.result.result.forEach((item,index)=>item.indexNumber=index+1)
						this.Model.tableData=data.result.result
					}else{
			
					}
				});
		},
		//详情
		toDetial(row) {
			this.$router.push({
				path:'certificationStorageListDetail',
				query:{
					number:row.number
				}
			});
		},
		//
		selectedHighlight(data) {
			// 如果选中则添加高亮样式
			if (this.Model.TableSelectData.indexOf(data.row) > -1) {
				return {
					"background-color": "#FEF6EE"
				};
				return {}
			}
		},
		warehousing(row) {
			this.Model.warehousingDialogStatus = row.status;
			this.Model.warehousingDialogFlag = true;
		},
		handleSelectionChange(val) {
			
		},
		handleCurrentChange(val) {
			var params = this.Model.searchFromData;
			this.getList(this,params,val);
		},
		handleSizeChange(val) {
			var params = this.Model.searchFromData;
			this.getList(this,params,undefined,val);
		},
		cardClick(color) {
			this.Model.cardSelected = color;
		},
		showChild(val) {
			this.Model.searchFromData = val;
		},
		toSearch(val) {
			var params = this.Model.searchFromData;
			this.getList(this,params);
		},
		toClear(val) {
			this.Model.searchFromData = {};
		},
		toExport(val) {
		  console.log(val);
		},
		tips(that,type,message) {
			that.$message({
				message: message,
				type: type
			});
		},
	},
	watch:{
		$route:{
		　　　handler(newValue, oldValue) {
				
		　　　},
		　　　deep: true
		},
  	
	},
	filters:{
		objFilters:function(value){
			
		}
	}
}
export default Controller;
